package ch7;

public class WorkerTest {

	public static void main(String[] args) {
		Thread.currentThread().setName("周扒皮");
		Worker w = new Worker("祥子");
		w.start();
		while (true) {
			try {
				Thread.sleep(1000);
				System.out.println("地主睡醒了，喊工人干活");
				if (!w.isInterrupted())
					w.interrupt();
				System.out.println("地主继续睡。。。");
			} catch (InterruptedException e) {
				// TODO 自动生成的 catch 块
				e.printStackTrace();
			}
		}
	}

}
